package com.starchen.optimalselection.common.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 商品二级分类
 * 
 * @author daxilong
 * @email daxilong@gmail.com
 * @date 2022-08-14 19:57:36
 */
@Data
@TableName("pms_category")
public class Category implements Serializable {

	@ApiModelProperty(value = "唯一标识")
	@TableId
	private Long id;

	@ApiModelProperty(value = "分类名称")
	private String name;

	@ApiModelProperty(value = "分类图片url")
	private String imageUrl;

	@ApiModelProperty(value = "父节点id")
	private Long parentId;

	@ApiModelProperty(value = "菜单层级")
	private Integer level;

	@ApiModelProperty(value = "排序字段")
	private Integer sort;

	@ApiModelProperty(value = "子节点List集合")
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	@TableField(exist = false)
	private List<Category> children;

	@ApiModelProperty(value = "创建时间")
	private Date createTime;

	@ApiModelProperty(value = "修改时间")
	private Date updateTime;

	@ApiModelProperty(value = "是否删除")
	@JsonIgnore
	@TableLogic
	private Integer isDeleted;

}
